from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, BooleanField, SubmitField,ValidationError,SelectField
from wtforms.validators import DataRequired,Length,EqualTo
from app.models import User,Plan

class PlanForm(FlaskForm):
	plan_name = StringField("计划名称", validators=[DataRequired()])
	plan_info = StringField("项目信息", validators=[DataRequired()])
	subject_id = SelectField("项目名称", validators=[DataRequired()],render_kw={},choices=[(1,'ITS')],default=1,coerce=int)
	submit = SubmitField('创建')
	
class CaseForm(FlaskForm):
	host = StringField("Host", validators=[DataRequired()])
	url = StringField("URL", validators=[DataRequired()])
	method = SelectField("接口类型",
		validators=[DataRequired()],
		render_kw={},
		choices=[(1, 'Post'), (2, 'Get')],
		default=1,
		coerce=int)
	parameter = StringField("参数", validators=[DataRequired()])
	expectation = StringField("预期结果", validators=[DataRequired()])
	depiction = StringField("用例描述", validators=[DataRequired()])
	submit = SubmitField('添加测试用例')